﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 基于WPF的电缆采样数据分析系统.Models.Dbs
{
    public class TDRDbContext : DbContext
    {
        

        /// <summary>
        /// 配置数据库连接
        /// </summary>
        /// <param name="optionsBuilder"></param>
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            string connStr = "Server=127.0.0.1;Database=TDRDBTest;User=root;port=3306;Password=123456;CharSet=utf8mb4;";
            optionsBuilder.UseMySql(connStr, ServerVersion.AutoDetect(connStr));
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            
        }

        /// <summary>
        /// 用户表
        /// </summary>
        public DbSet<User> Users { get; set; }
        /// <summary>
        /// 用户等级表
        /// </summary>
        public DbSet<Grade> Grades { get; set; }
        /// <summary>
        /// 导入波形日志表
        /// </summary>
        public DbSet<ImportWavLog> ImportWavLogs { get; set; }
        /// <summary>
        /// 邀请码生成记录
        /// </summary>
        public DbSet<InvitationCodeRecord> InvitationCodeRecords { get; set; }
        /// <summary>
        /// 用户使用记录
        /// </summary>
        public DbSet<UserUsedRecord> UserUsedRecords { get; set; }
        /// <summary>
        /// 工程数据信息
        /// </summary>
        public DbSet<ProjectDataInfoDAO> ProjectDataInfoDAOs { get; set; }
        /// <summary>
        /// 导出任务信息
        /// </summary>
        public DbSet<TaskDataInfoDAO> TaskDataInfoDAOs { get; set; }
        /// <summary>
        /// 操作日志信息
        /// </summary>
        public DbSet<AllUsedLogDAO> AllUsedLogDAOs { get; set; }
        /// <summary>
        /// 导出波形信息
        /// </summary>
        public DbSet<UpdateWavListDAO> UpdateWavListDAOs { get; set; }


    }
}
